<template>
  <div @click="onClick" class="my-award-wrapper">
    <div class="my-award-container">
      <div class="award-list" v-if= "prize">
        <div class="award-item">
          <img :src="prize.awardPic" alt=""/>
        </div>
      </div>
      <div v-else class="no-award">暂无</div>
    </div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
  name: 'MyAwardComponent',
  data () {
    return {}
  },
  computed: {
    ...mapGetters(['prize'])
  },
  methods: {
    onClick () {
      this.$sound && this.$sound.play()
      this.$emit('click')
    }
  }
}
</script>
<style lang="scss" scoped>
@import "../assets/css/mixin.scss";
.my-award-wrapper {
  width: 100vw;
  height: 100vh;
}
.my-award-container {
  width: 634px;
  min-height: 325px;
  background: url(../assets/img/award/award_bg.png);
  background-size: 100% auto;
  border-radius: 20px;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  position: absolute;
  padding: 114px 0 43px ;
}
.award-list {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  flex-direction:row;;
  justify-content: center;
  font-size: 0;
}
.award-item {
  @include wh(212, 204);
  &:nth-child( n + 3) {
    margin-top: 29px;
  }
  &:nth-child(even) {
    margin-left: 67px;
  }
  img {
    width: 100%;
    height: 100%;
  }
}
.no-award {
  color: #990c13;
  font-size: 39px;
  padding: 29px 0;
  line-height: 1;
}
</style>
